//external.cpp -- enternal variables
//compile with support.cpp

//usenmsp.cpp --using namespaces
#include "namesp_9_11.h"
void other_9_13();
void another_9_13();
void Example_9_13();

#include <iostream>


//external variable
double warming = 0.3;		//warming defined
							//function prototypes
void update(double dt);
void local();
void Example_9_5();

//int main()					//uses global variable
//{
//	//other_9_13();
//	//Example_9_5();
//	return 0;
//}

void Example_9_5()
{
	using namespace std;
	cout << "Global warming is " << warming << " degrees.\n";
	update(0.1);			//call function to change warming
	cout << "Global warming is " << warming << " degrees.\n";
	local();				//call function with local warming 
	cout << "Glabal warming is " << warming << " degrees.\n";
	return;
}

void Example_9_13()
{
	using debts::Debt;

	using debts::showDebt;
	Debt golf = { {"Benny", "Goatsniff"},120.0 };
	showDebt(golf);
	other_9_13();
	another_9_13();
	return;
}

void other_9_13()
{
	using std::cout;
	using std::endl;
	using namespace debts;
	Person dg = { "Doodles", "Glister" };
	showPerson(dg);
	cout << endl;
	Debt zippy[3];
	int i;
	for (i = 0; i < 3; i++)
		getDebt(zippy[i]);

	for (i = 0; i < 3; i++)
		showDebt(zippy[i]);
	cout << "Total debt: $" << sumDebts(zippy, 3) << endl;
	return;
}
void another_9_13()
{
	using pers::Person;
	Person collector = { "Milo", "Rightshift" };
	pers::showPerson(collector);
	std::cout << std::endl;
	return;
}


